<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .father {
            width: 300px;
            height: 300px;
            border: 1px solid #000;
            /* 设置盒模型 flex */
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: space-around;
        }

        .son {
            /* 宽度 */
            width: 50px;
            /* 高度 */
            height: 50px;
            /* 文字颜色 */
            background-color: red;
            /* 文字居中 */
            text-align: center;
            /* lineheight和height一样就是垂直居中 */
            line-height: 50px;
        }
    </style>
</head>

<body>
    <div class="father">
        <div class="son">1</div>
        <div class="son">2</div>
        <div class="son">3</div>
        <div class="son">4</div>
        <div class="son">5</div>
        
    </div>
</body>

</html>